package copy.pojo;

import copy.mark.ParamMaps;

import javax.lang.model.element.AnnotationMirror;

import java.util.ArrayList;
import java.util.List;

/**
 * author: liziyun
 * date: 2019-9-30
 * email: root@ofo.email
 * describe: 方法元数据信息
 *      存储属性的映射关系 和 类型转换器
 */
public class MethodMeta {

    private String methodName;

    private Class resourceClass;
    private Class targetClass;
    //已经提前实例化目标对象
    private boolean eagerInstance=false;
    //是否使用@Params注解
    private boolean openParam;
    //是否启动@Clone注解
    private boolean clone = false;

    private  List<? extends AnnotationMirror> annotationMirrorList;
    private ParamMaps paramMapsAnnotation;

    //字段映射数据
    private List<PropertyMeta> propertyMetas = new ArrayList<>();

    public void addPropertyMeta(PropertyMeta propertyMeta){
        propertyMetas.add(propertyMeta);
    }

    public boolean isEagerInstance() {
        return eagerInstance;
    }

    public void setEagerInstance(boolean eagerInstance) {
        this.eagerInstance = eagerInstance;
    }

    public List<PropertyMeta> getPropertyMetas() {
        return propertyMetas;
    }

    public void setPropertyMetas(List<PropertyMeta> propertyMetas) {
        this.propertyMetas = propertyMetas;
    }

    public boolean isOpenParam() {
        return openParam;
    }

    public void setOpenParam(boolean openParam) {
        this.openParam = openParam;
    }


    public boolean isClone() {
        return clone;
    }

    public void setClone(boolean clone) {
        this.clone = clone;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public  List<? extends AnnotationMirror> getAnnotationMirrorList() {
        return annotationMirrorList;
    }

    public void setAnnotationMirrorList( List<? extends AnnotationMirror> annotationMirrorList) {
        this.annotationMirrorList = annotationMirrorList;
    }

    public ParamMaps getParamMapsAnnotation() {
        return paramMapsAnnotation;
    }

    public void setParamMapsAnnotation(ParamMaps paramMapsAnnotation) {
        this.paramMapsAnnotation = paramMapsAnnotation;
    }
}
